/*
 DNN Content Builder - sourceforge.net/projects/dnncb
 Copyright (c) 2004-2008
 by Emerson Lopes (emersonlopes@gmail.com)

 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
 documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
 the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
 to permit persons to whom the Software is furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in all copies or substantial portions 
 of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
 TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 DEALINGS IN THE SOFTWARE.
*/
using System;
using System.Xml.Serialization;

namespace DNNContentBuilder.Configuration
{
	/// <summary>
	/// Summary description for FormletData.
	/// </summary>
	[XmlRoot("formlet")]
	public class FormletData
	{
		#region Member Variables
		private string name;
		private string assembly;
		private string control;
		private string definition;
		private string configFile;
		#endregion

		#region Constructors
		/// <summary>
		/// Initializes a new instance of the <see cref="FormletConfiguration"/> class
		/// </summary>
		public FormletData()
		{
		}

		/// <summary>
		/// Initializes a new instance of the FieldControlConfiguration class
		/// </summary>
		/// <param name="name"></param>
		/// <param name="assembly"></param>
		/// <param name="control"></param>
		/// <param name="definition"></param>
		/// <param name="xml"></param>
		public FormletData(
			string name,
			string assembly,
			string control,
			string definition,
			string configFile)
		{
			this.name		= name;
			this.assembly	= assembly;
			this.control	= control;
			this.definition	= definition;
			this.configFile = configFile;
		}
		#endregion

		#region Properties
		/// <summary>
		/// Gets the name of the formlet.
		/// </summary>
		[XmlElement("name", IsNullable=false)]
		public string Name
		{
			get
			{
				return this.name;
			}
			set
			{
				this.name = value;
			}
		}

		/// <summary>
		/// Gets the name of the assembly that contains the formlet.
		/// </summary>
		[XmlElement("assembly", IsNullable=false)]
		public string Assembly
		{
			get
			{
				return this.assembly;
			}
			set
			{
				this.assembly = value;
			}
		}

		/// <summary>
		/// Gets the name of the type that represents the 
		/// visual part of the formlet.
		/// </summary>
		[XmlElement("control", IsNullable=false)]
		public string ControlType
		{
			get
			{
				return this.control;
			}
			set
			{
				this.control = value;
			}
		}

		/// <summary>
		/// Gets the name of the type that represents the 
		/// control definition part of the formlet.
		/// </summary>
		[XmlElement("definition", IsNullable=false)]
		public string DefinitionType
		{
			get
			{
				return this.definition;
			}
			set
			{
				this.definition = value;
			}
		}

		/// <summary>
		/// Gets the XML string that contains formlet configuration
		/// options.
		/// </summary>
		[XmlElement("configFile", IsNullable=false)]
		public string ConfigFile
		{
			get
			{
				return this.configFile;
			}
			set
			{
				this.configFile = value;
			}
		}
		#endregion
	}
}
